package com.zt.rongda.companyIncome.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zt.rongda.companyIncome.service.CompanyIncomeAnalyzeService;
import com.zt.servlet.ReqBean;
import com.zt.servlet.RequestAttribute;
import com.zt.servlet.Response;

import net.sf.json.JSONObject;

@Controller
@RequestMapping(value = "/companyIncomeAnalyze")
public class CompanyIncomeAnalyzeController {

	@Autowired
	private CompanyIncomeAnalyzeService companyIncomeAnalyzeService;

	@RequestMapping(value = "/analyze")
	@ResponseBody
	public JSONObject query(@RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
		String payRollYear = reqBean.getInfo("payRollYear");
		String payRollMonth = reqBean.getInfo("payRollMonth");
		return Response.response(companyIncomeAnalyzeService.analyze(payRollYear,payRollMonth));
	}

}